import subprocess
import shlex

if __name__ == '__main__':
    command = input("请输入要执行的命令：")
    try:
        a = subprocess.run(shlex.split(command),stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True,check=True)
        print(a.stdout.decode('gbk'))
    except Exception as e:
        print(e.stderr.decode('gbk'))
